home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
PC Tools ThreatFire
/
tfinstall.exe
/
{app}
/
TFGui.exe
/
HTML
/
JAVASCRIPT.JS
< prev
next >
Wrap
Text File
|
2010-01-14
|
3KB
|
169 lines
var g_oNib;
var g_nNibX;
var g_nCursorX;;
function FindPosX(o)
{
var x = 0;
while (o.offsetParent)
{
x += o.offsetLeft
o = o.offsetParent;
}
return x;
}
function OnMoveNib(oNib)
{
g_oNib = oNib;
g_nNibX = g_oNib.style.pixelLeft;
g_nCursorX = event.clientX;
document.onmousemove = OnDragNib;
document.onmouseup = OnDropNib;
}
function OnDragNib()
{
var x = g_nNibX + (event.clientX - g_nCursorX);
if (x < 0)
x = 0;
else if (x > parseInt(g_oNib.parentElement.style.width) - parseInt(g_oNib.style.width) - 4)
x = parseInt(g_oNib.parentElement.style.width) - parseInt(g_oNib.style.width) - 4;
g_oNib.style.left = x;
return false;
}
function OnDropNib()
{
var x = parseInt(g_oNib.style.left) + 4;
SnapSlider(x);
document.onmousemove = null;
document.onmouseup = null;
}
function OnSliderClicked(oSlider)
{
var x = event.clientX - FindPosX(oSlider);
SnapSlider(x);
}
function SnapSlider(x)
{
if (x < 20)
x = 1;
else if (x < 50)
x = 2;
else if (x < 80)
x = 3;
else if (x < 110)
x = 4;
else
x = 5;
var oNib = document.getElementById('Nib');
var oDetails = document.getElementById('Details');
switch (x)
{
case 1: oNib.style.left = 0; break;
case 2: oNib.style.left = 29; break;
case 3: oNib.style.left = 59; break;
case 4: oNib.style.left = 88; break;
case 5: oNib.style.left = 118; break;
}
location.href = 90 + x;
}
function SelectAll(oCheckBox)
{
var oChecks = document.getElementsByName('Checkbox');
for (var i = 0; i < oChecks.length; i++)
oChecks[i].checked = oCheckBox.checked;
}
function FixSelectAll(oCheckBox)
{
if (!oCheckBox.checked)
document.getElementById('SelectAll').checked = false;
}
function SelectMe(nIndex)
{
var nMax = 10;
for (var i = 1; i <= nMax; i++)
{
var e = document.getElementById('Row' + i);
if (null == e)
break;
e.className = (i == nIndex) ? 'selected' : 'unselected';
}
for (var i = 1; i <= nMax; i++)
{
var e = document.getElementById('Img' + i);
if (null == e)
break;
e.src = (i == nIndex) ? 'Arrow.gif' : 'Spacer.gif';
}
for (var i = 1; i <= nMax; i++)
{
var e = document.getElementById('Div' + i);
if (null == e)
break;
e.style.display = (i == nIndex) ? '' : 'none';
}
}
function Show()
{
for (var i = 0; i < arguments.length; i++)
document.getElementById(arguments[i]).style.display = '';
}
function Hide()
{
for (var i = 0; i < arguments.length; i++)
document.getElementById(arguments[i]).style.display = 'none';
}
function OnLogLoaded()
{
document.getElementById('List').style.height =
338 - document.getElementById('Explain').offsetHeight - document.getElementById('Links').offsetHeight;
}
function ShowSubView(n)
{
try
{
document.getElementById('Div' + n).style.display = '';
document.getElementById('Button' + n).className = 'selected';
for (var i = 1; i < 10; i++)
{
if (i != n)
{
document.getElementById('Div' + i).style.display = 'none';
document.getElementById('Button' + i).className = '';
}
}
}
catch (err)
{
}
}